package com.pandora.credit.mongo.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;

/**
 * @author developer
 */
@Document(collection = "credits")
public class MongoCredit {

    @Field("_id")
    @JsonProperty("_id")
    private Long id;
    private String type;
    @Field("created_time")
    @JsonProperty("created_time")
    private Date createdTime;
    @Field("updated_time")
    @JsonProperty("updated_time")
    private Date updatedTime;
    private String name;
    @Field("img_url")
    @JsonProperty("img_url")
    private String imgUrl;
    @Field("dest_url")
    @JsonProperty("dest_url")
    private String destUrl;
    private MongoCreditItem item;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getDestUrl() {
        return destUrl;
    }

    public void setDestUrl(String destUrl) {
        this.destUrl = destUrl;
    }

    public MongoCreditItem getItem() {
        return item;
    }

    public void setItem(MongoCreditItem item) {
        this.item = item;
    }

    public static class MongoCreditFee {
        private String value;
        private String unit;

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getUnit() {
            return unit;
        }

        public void setUnit(String unit) {
            this.unit = unit;
        }
    }

    public static class MongoCreditLoanPeriod {
        private String value;
        private String unit;

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getUnit() {
            return unit;
        }

        public void setUnit(String unit) {
            this.unit = unit;
        }
    }

    public static class MongoCreditAmount {
        private Integer minimum;
        private String value;
        private String unit;
        private Integer maximum;

        public Integer getMinimum() {
            return minimum;
        }

        public void setMinimum(Integer minimum) {
            this.minimum = minimum;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getUnit() {
            return unit;
        }

        public void setUnit(String unit) {
            this.unit = unit;
        }

        public Integer getMaximum() {
            return maximum;
        }

        public void setMaximum(Integer maximum) {
            this.maximum = maximum;
        }
    }

    public static class MongoCreditApprovalTime {
        private String value;
        private String unit;

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getUnit() {
            return unit;
        }

        public void setUnit(String unit) {
            this.unit = unit;
        }
    }

    public static class MongoCreditItem {
        private Integer count;
        private Integer status;
        private MongoCreditFee fee;
        private String description;
        @Field("icon_url")
        @JsonProperty("icon_url")
        private String iconUrl;
        @Field("description_list")
        @JsonProperty("description_list")
        private String[] descriptionList;
        @Field("loan_name")
        @JsonProperty("loan_name")
        private String loanName;
        @Field("loan_period")
        @JsonProperty("loan_period")
        private MongoCreditLoanPeriod loanPeriod;
        private MongoCreditAmount amount;
        private Integer recommend;
        private String organization;
        @Field("approval_time")
        @JsonProperty("approval_time")
        private MongoCreditApprovalTime approvalTime;
        @Field("img_url")
        @JsonProperty("img_url")
        private String imgUrl;
        @Field("dest_url")
        @JsonProperty("dest_url")
        private String destUrl;
        private Long id;

        public Integer getCount() {
            return count;
        }

        public void setCount(Integer count) {
            this.count = count;
        }

        public Integer getStatus() {
            return status;
        }

        public void setStatus(Integer status) {
            this.status = status;
        }

        public MongoCreditFee getFee() {
            return fee;
        }

        public void setFee(MongoCreditFee fee) {
            this.fee = fee;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public MongoCreditAmount getAmount() {
            return amount;
        }

        public void setAmount(MongoCreditAmount amount) {
            this.amount = amount;
        }

        public Integer getRecommend() {
            return recommend;
        }

        public void setRecommend(Integer recommend) {
            this.recommend = recommend;
        }

        public String getOrganization() {
            return organization;
        }

        public void setOrganization(String organization) {
            this.organization = organization;
        }

        public String getIconUrl() {
            return iconUrl;
        }

        public void setIconUrl(String iconUrl) {
            this.iconUrl = iconUrl;
        }

        public String[] getDescriptionList() {
            return descriptionList;
        }

        public void setDescriptionList(String[] descriptionList) {
            this.descriptionList = descriptionList;
        }

        public String getLoanName() {
            return loanName;
        }

        public void setLoanName(String loanName) {
            this.loanName = loanName;
        }

        public MongoCreditLoanPeriod getLoanPeriod() {
            return loanPeriod;
        }

        public void setLoanPeriod(MongoCreditLoanPeriod loanPeriod) {
            this.loanPeriod = loanPeriod;
        }

        public MongoCreditApprovalTime getApprovalTime() {
            return approvalTime;
        }

        public void setApprovalTime(MongoCreditApprovalTime approvalTime) {
            this.approvalTime = approvalTime;
        }

        public String getImgUrl() {
            return imgUrl;
        }

        public void setImgUrl(String imgUrl) {
            this.imgUrl = imgUrl;
        }

        public String getDestUrl() {
            return destUrl;
        }

        public void setDestUrl(String destUrl) {
            this.destUrl = destUrl;
        }

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }
    }


}
